package com.mybindview.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;

import com.mybindview.R;
import com.mybindview.adapter.RecyclerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by nbzl on 2017/2/28.
 */
public class TextActivity extends AppCompatActivity {

    private RecyclerView listview;
    private RecyclerAdapter adapter;
    private List<String> datalist;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text);
        datalist=new ArrayList<String>();
        listview=(RecyclerView)findViewById(R.id.listview);
        listview.setLayoutManager(new LinearLayoutManager(this));
        for(int i=0;i<4;i++){
            datalist.add("--->"+i);
        }
        Log.e("Mytext","size--->"+datalist.size());
        adapter=new RecyclerAdapter(this,datalist);
        listview.setAdapter(adapter);
    }
}
